package com.sqf.soft.utils;

import java.util.HashMap;
import java.util.Map;

public class SystemConstant {

    public static final int CLASSIFY_INIT_LEVEL = 1;
    public static final int NO = 0;

    public static final int SUCCESS = 0;
    public static final int SELECT_EXCEPTION = -1001;
    public static final int SELECT_RESULT_IS_NULL = -1002;
    public static final int INSERT_EXCEPTION = -1101;
    public static final int UPDATE_EXCEPTION = -1201;
    public static final int DELETE_EXCEPTION = -1301;
    public static final int USER_USERNAME_IS_BLANK = -2001;
    public static final int USER_PASSWORD_IS_BLANK = -2002;
    public static final int CLASSIFY_NAME_IS_BLANK = -3001;
    public static final int CLASSIFY_PARENT_IS_NULL = -3002;
    public static final int STATEMENT_CLASSIFY_IS_NULL = -4001;
    public static final int STATEMENT_MONEY_IS_NULL = -4002;
    public static final int STATEMENT_USER_IS_NULL = -4003;
    private static final Map<Integer, String> commentMap = new HashMap<>();

    static {
        commentMap.put(SUCCESS, "");
        commentMap.put(SELECT_EXCEPTION, "查询失败");
        commentMap.put(SELECT_RESULT_IS_NULL, "查询结果为空");
        commentMap.put(INSERT_EXCEPTION, "添加失败");
        commentMap.put(UPDATE_EXCEPTION, "更新失败");
        commentMap.put(DELETE_EXCEPTION, "删除失败");
        commentMap.put(USER_USERNAME_IS_BLANK, "账号为空");
        commentMap.put(USER_PASSWORD_IS_BLANK, "密码为空");
        commentMap.put(CLASSIFY_NAME_IS_BLANK, "分类名称为空");
        commentMap.put(CLASSIFY_PARENT_IS_NULL, "上级分类为空");
        commentMap.put(STATEMENT_CLASSIFY_IS_NULL, "分类为空");
        commentMap.put(STATEMENT_MONEY_IS_NULL, "金额为空");
        commentMap.put(STATEMENT_USER_IS_NULL, "用户为空");
    }

    static String getCommentByCode(int code) {
        return commentMap.get(code);
    }
}
